public class OddNumberOccurenceInArray {

	// Find the number which repeat odds times in a array.(only one such number)
	public static void main(String[] args) {
		
		int []array = { 5, 7, 9, 44, 5, 5, 8, 12, 9, 9, 8, 44, 12, 44, 44, 7, 5};
		System.err.println("odd number: " + getOddNumber(array));
	}

	private static int getOddNumber(int[] array) {
		int first = array[0];
		for(int i=1; i<array.length; i++) {
			first ^= array[i];
		}
		return first;
	}
}
